﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ProtoBuf;
using System.Runtime.Serialization;

namespace SchemaMonitor.json
{

    [DataContract]
    public class CMetaField
    {
        //Data
        [DataMember(Order = 1)] public readonly string Name;
        [DataMember(Order = 2)] public readonly string Description;
        [DataMember(Order = 3)] public readonly string Type;

        //Constructors
        public CMetaField(Dictionary<string, object> dict) : this(new CDict(dict)) { }
        public CMetaField(CDict d) 
        {
            Name = d.AsStr("name");
            Type = d.AsStr("type");
            Description = d.AsStr("description");
        }
        private CMetaField() { }
        static CMetaField() { ProtoBuf.Serializer.PrepareSerializer<CMetaField>(); }
    }
}
